﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Development.DbData;

namespace Development.DataEntity
{
    /// <summary>
    /// 排行榜数据基类
    /// </summary>
    public class RankingEntity : DataEntityBase
    {
        [DbData]
        public int Score { get; set; }
        /// <summary>
        /// 比较方法
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public override int CompareTo(object obj)
        {
            RankingEntity r = obj as RankingEntity;
            if (this.Score > r.Score)
            {
                return -1;
            }
            else if (this.Score < r.Score)
            {
                return 1;
            }
            else
            {
                return 0;
            }
        }
    }
}
